#ifndef __PlayerUI__
#define __PlayerUI__

#include "IDialog.h"
#include "PokerPlayer.h"
#include "CardUI.h"

class PlayerUI : public IDialog<Layer>
{
public:
    PlayerUI();
    virtual ~PlayerUI();
    CREATE_FUNC(PlayerUI);

    void setPlayer(std::shared_ptr<PokerPlayer> player);

    // 不换人再来一局, 清理UI
    void cleanUI();

    void refreshUI(bool cardInMode);
    void onClickCardUI(Ref* sender);

    void resetCardSelect();
    bool tipCardSelect();

    void cardOut();

    bool canPushCard() const;

    virtual void onEnter();
    virtual void onExit();

protected:
    virtual const char* csbName() const {return "ui/Player.csb";}
	virtual void onUILoaded();
    virtual void update(float delta);

private:
    PLAYER_STATE m_state;
    CARD_TYPE    m_select_type;
    std::shared_ptr<PokerPlayer> m_player;
    Sprite* num_bg;
    Sprite* flag_lord;
    Sprite* clock;
    Sprite* icon_head;
    Text* txt_count;
    Text* txt_tick;
    Node* m_cradAreaHand;
    Node* m_cradAreaOut;
    Sprite * m_skip;
    std::vector<CardUI*> m_handCardUI;
};

#endif 

